home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-162.txt < prev    next >
Encoding:
Text File  |  1992-12-31  |  54.5 KB  |  1,317 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Sat, 08 Aug 92       Volume 1 : Issue 162
  2.  
  3. Today's Topics:
  4.  
  5.     Location of selected printer?
  6.     Religious Question: How Do The Metaphors Fit Together?
  7.     Is System 7 written in C++?
  8.  
  9.  
  10.  
  11. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  12.  
  13. The digest is a collection of article threads from the internet newsgroup
  14. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  15. regularly and want an archive of the discussions.  If you don't know what a
  16. newsgroup is, you probably don't have access to it.  Ask your systems
  17. administrator(s) for details.  (This means you can't post questions to the
  18. digest.)
  19.  
  20. Each issue of the digest contains one or more sets of articles (called
  21. threads), with each set corresponding to a 'discussion' of a particular
  22. subject.  The articles are not edited; all articles included in this digest
  23. are in their original posted form (as received by our news server at
  24. cs.uoregon.edu).  Article threads are not added to the digest until the last
  25. article added to the thread is at least one month old (this is to ensure that
  26. the thread is dead before adding it to the digest).  Article threads that
  27. consist of only one message are generally not included in the digest.
  28.  
  29. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  30. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  31. file /pub/mac/csmp-digest/README before downloading any files.  The most
  32. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  33. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  34. archive has a mail server; send a message with the text '$MACarch help' (no
  35. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  36.  
  37. The digest is also available via email.  Just send a note saying that you
  38. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  39. automatically receive each new issue as it is created.  Sorry, back issues
  40. are not available through the mailing list.
  41.  
  42. Send administrative mail to mkelly@cs.uoregon.edu.
  43.  
  44.  
  45. -------------------------------------------------------
  46.  
  47. From: cinquin@imag.fr ( Philippe Cinquin)
  48. Subject: Location of selected printer?
  49. Date: 3 Jul 92 17:30:42 GMT
  50. Organization: IMAG Institute, University of Grenoble, France
  51.  
  52. Just a simple question (I hope!): where is the name of the printer choosen
  53. by the user through the chooser stored? How can I get it and change it?
  54. (I know I normally shouldn't change it, but this is a special case).
  55.  
  56. If you email please do so at " ocinquin@timb.imag.fr ". Thanks in advance.
  57.  
  58. +++++++++++++++++++++++++++
  59.  
  60. From: zobkiw@world.std.com (Joe Zobkiw)
  61. Date: 4 Jul 92 16:07:47 GMT
  62. Organization: The World Public Access UNIX, Brookline, MA
  63.  
  64. The name of the printer is stored in the printer driver. The name of the
  65. printer driver is stored in the system file. There are some gotchas if you
  66. try to change these, so don't! That's what the Chooser is for.
  67.  
  68.  
  69. - -- 
  70. - -- joe zobkiw                      Internet: zobkiw@world.std.com
  71. - --                                      AOL: AFL Zobkiw  
  72. - -- mac.synthesis.MIDI.THINK C.OOP
  73. - -- asm.comm.networks.cool tunes...
  74.  
  75. ---------------------------
  76.  
  77. From: orpheus@reed.edu (P. Hawthorne)
  78. Subject: Religious Question: How Do The Metaphors Fit Together?
  79. Date: 6 Jul 92 01:03:41 GMT
  80. Organization: Reed College, Portland OR
  81.  
  82. I am afraid I am a casualty of object orientation. In trying to put the
  83. parts of the standard user interface together in a consistent framework,
  84. I have become confused about how they ought to fit together.  I feel like
  85. Winnie the Pooh looking for the North Pole, blind to the metal rod right
  86. under his very nose... :-)
  87.  
  88. The notion of a selection dominates the edit commands, even more so than
  89. the clipboard. If there is no current selection, the cut, copy and clear
  90. commands are dim. If there is no chance of having a selection in a given
  91. situation or the selection does not accept the contents of the clipboard,
  92. the paste command is dim. So, it appears that the clipboard is a servant of
  93. the selection. Fine, great, so...
  94.  
  95. The selection itself appears to be an aspect of the window. The window
  96. draws and erases the selection when it is activated or deactivated.
  97. However, when one has more than one window open showing part of the same
  98. document, the windows are actually sharing the same selection. So the
  99. selection can be an aspect of the window that is actually a reference to
  100. an aspect of the document.
  101.  
  102. As if that were way too easy, some windows use one of many forms of
  103. selection which might not have anything to do with the document per se.
  104. Windows such as dialogs that edit a part of the document often have their
  105. own notion of selection such as: the blinking insertion caret in an edit
  106. text dialog item; or a window in which one can have selected either
  107. icons, part of the name of an icon, or arcs between icons.
  108.  
  109. So at any time there is one current application, one current window that
  110. implies one current document, and one current selection. Does this sound
  111. right or am I missing something? Does anyone else wonder about all this?
  112. Could it be that I have become completely obsessed?
  113.  
  114.  Theus (orpheus@reed.edu)
  115. (If you consider this a waste of bandwidth, I beg your pardon.)
  116.  
  117. +++++++++++++++++++++++++++
  118.  
  119. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  120. Date: 6 Jul 92 06:38:40 GMT
  121. Organization: University of Waikato, Hamilton, New Zealand
  122.  
  123. In article <1992Jul6.010341.9143@reed.edu>, orpheus@reed.edu (P. Hawthorne)
  124. writes:
  125.  
  126. [sorry for rearranging the bits of your posting, but it seemed easier
  127. to respond to them in this order...]
  128.  
  129. > So at any time there is one current application, one current window that
  130. > implies one current document, and one current selection.
  131.  
  132. Yup, this is how it's supposed to be. It's certainly what the AppleEvent
  133. Object Model expects.
  134.  
  135. > As if that were way too easy, some windows use one of many forms of
  136. > selection which might not have anything to do with the document per se.
  137. > Windows such as dialogs that edit a part of the document often have their
  138. > own notion of selection such as: the blinking insertion caret in an edit
  139. > text dialog item; or a window in which one can have selected either
  140. > icons, part of the name of an icon, or arcs between icons.
  141.  
  142. Well, the selection has to do with whatever is being manipulated in the
  143. window. The window might be a dialog for examining and changing settings
  144. to do with a document. Consider the standard PutFile dialog in System 7;
  145. the current selection can either be an item in a list, or some part of
  146. an editable text field. The only reason you can't select both sorts of
  147. things at once is simply because it doesn't make sense, given the way
  148. the dialog is supposed to work.
  149.  
  150. > The selection itself appears to be an aspect of the window. The window
  151. > draws and erases the selection when it is activated or deactivated.
  152. > However, when one has more than one window open showing part of the same
  153. > document, the windows are actually sharing the same selection. So the
  154. > selection can be an aspect of the window that is actually a reference to
  155. > an aspect of the document.
  156.  
  157. In my experience, the handling of multiple views of the same document
  158. tends to vary somewhat. In spite of all the bad things that M#%$#S@ft have
  159. done, Excel *can* serve as a useful model in this one respect: it lets
  160. you split a window into panes, so that you can do useful things like
  161. manipulate all four corners of a large rectangular selection without lots
  162. of scrolling.
  163.  
  164. The MPW Shell (3.2 and later) has a similar, if more elaborate, scheme.
  165. It only shows you the selection in one window pane at a time, but otherwise
  166. the selection behaves similarly to Excel--you can click at one point in
  167. one pane, and then shift-click at a different point being shown in another
  168. pane, to select everything between those two points in the document.
  169.  
  170. For those applications that let you open multiple separate windows
  171. showing the same document, the selection in each window is usually independent.
  172. Thus, it might be considered to be a property of the window, not of the
  173. document. But then the question arises of which selection you save with the
  174. document.
  175.  
  176. I just checked this in Claris Resolve, and it's got a solution I wasn't
  177. aware of before. I opened a new worksheet, selected cell C17, typed something
  178. into it, and then saved and closed the worksheet. Then I reopened it, asked
  179. for a "New View" (which creates a new window showing the same document),
  180. selected cell C6 in the new window, and typed something else in, leaving
  181. C6 selected. Next I went back to the first window, where cell C17 was still
  182. selected, and saved my changes with that window in front. And guess what--it
  183. saved the fact that I had two views open! When I reopened the document, I got
  184. two windows, the first with cell C17 selected, the second with cell C6 selected.
  185.  
  186. So there's an interesting solution for you. I still wish Resolve had
  187. Excel-style panes (and no, "Titles" are *not* a satisfactory substitute), but
  188. it's obvious the user-interface folks at Claris haven't been *completely*
  189. asleep. :-)
  190.  
  191. > Could it be that I have become completely obsessed?
  192.  
  193. All the good Mac hackers are. :-)
  194.  
  195. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  196. Computer Services Dept                     fax: +64-7-838-4066
  197. University of Waikato            electric mail: ldo@waikato.ac.nz
  198. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  199. Ask not for whom the phone rings; it rings for you.
  200.  
  201. ---------------------------
  202.  
  203. From: ian@syacus.acus.oz.au (Ian Joyner)
  204. Subject: Is System 7 written in C++?
  205. Organization: ACUS Australian Centre for Unisys Software, Sydney
  206. Date: Thu, 28 May 1992 01:34:08 GMT
  207.  
  208. Kent,
  209.  
  210. Here is a question for you or anyone else who cares to clarify this point.
  211. You may have read in comp.lang.c++ that Andrew Koenig claimed that
  212. system 7 was rewritten in C++, from object Pascal. To my knowledge
  213. previous systems were written in 68000 assembler, not OP. I believe
  214. Finder has been rewritten in C++ (can't remember where I got this from,
  215. maybe this newsgroup), but has the whole of system 7 been written
  216. in C++?
  217.  
  218. Thanks for the clarification :-)
  219.  
  220. - -- 
  221. Ian Joyner                                     ACSNet: ian@syacus.acus.oz
  222. ACUS (Australian Centre for Unisys Software)   Internet: ian@syacus.acus.oz.au
  223. 115-117 Wicks Rd, North Ryde, N.S.W, Australia 2113.
  224. Tel 61-2-390 1328      Fax 61-2-390 1391       UUCP: ...uunet!munnari!syacus.oz
  225.  
  226. +++++++++++++++++++++++++++
  227.  
  228. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  229. Date: 28 May 92 18:05:30 GMT
  230. Organization: Peirce Software
  231.  
  232.  
  233. In article <1992May28.013408.27837@syacus.acus.oz.au> (comp.sys.mac.programmer), ian@syacus.acus.oz.au (Ian Joyner) writes:
  234. > Kent,
  235. > Here is a question for you or anyone else who cares to clarify this point.
  236. > You may have read in comp.lang.c++ that Andrew Koenig claimed that
  237. > system 7 was rewritten in C++, from object Pascal. To my knowledge
  238. > previous systems were written in 68000 assembler, not OP. I believe
  239. > Finder has been rewritten in C++ (can't remember where I got this from,
  240. > maybe this newsgroup), but has the whole of system 7 been written
  241. > in C++?
  242.  
  243. I think it's difficult to say that any particular language was used
  244. to write the Mac system.  Parts are writtren in a variety of languages.
  245. 680X0 asm is a good chunk, Pascal and C code are in there in some
  246. places.  C++ was used to write most of the new Finder.
  247.  
  248. What does it really matter?
  249.  
  250. - --  Michael Peirce      --   peirce@outpost.SF-Bay.org
  251. - --  Peirce Software     --   Suite 301, 719 Hibiscus Place
  252. - --  Makers of...        --   San Jose, California USA 95117
  253. - --                      --   voice: (408) 244-6554 fax: (408) 244-6882
  254. - --     SMOOTHIE         --   AppleLink: peirce & America Online: AFC Peirce
  255.  
  256. +++++++++++++++++++++++++++
  257.  
  258. From: casseres@apple.com (David Casseres)
  259. Date: 28 May 92 16:50:39 GMT
  260. Organization: Apple Computer, Inc.
  261.  
  262. In article <1992May28.013408.27837@syacus.acus.oz.au>, ian@syacus.acus.oz.au
  263. (Ian Joyner) writes:
  264.  
  265. > Here is a question for you or anyone else who cares to clarify this point.
  266. > You may have read in comp.lang.c++ that Andrew Koenig claimed that
  267. > system 7 was rewritten in C++, from object Pascal. To my knowledge
  268. > previous systems were written in 68000 assembler, not OP. I believe
  269. > Finder has been rewritten in C++ (can't remember where I got this from,
  270. > maybe this newsgroup), but has the whole of system 7 been written
  271. > in C++?
  272.  
  273. Parts of System 7, notably the Finder, were rewritten in C++.  Parts are in C,
  274. and some parts may still be Pascal.  I don't believe any of it was ever Object
  275. Pascal, but previous systems were written in a mixture of assembly and Pascal.
  276.  
  277. (I guess if you want to be very technical about it, Mac Pascal *is* Object
  278. Pascal, but the system code never used the object-oriented extensions.)
  279.  
  280. Some of the more macho types who worked on early versions of the system liked to
  281. give the impression that it was all written in 68000 assembly code, but this was
  282. never true.
  283.  
  284. It's always amazed me how much folklore swirls around the question of what
  285. languages have been used to implement the Mac system.  A few years back there
  286. was a totally bogus story that the entire system had been rewritten in C instead
  287. of Pascal, making it much faster.
  288.  
  289. - --
  290. David Casseres
  291. Exclaimer: Wow!
  292.  
  293. +++++++++++++++++++++++++++
  294.  
  295. From: casseres@apple.com (David Casseres)
  296. Date: 28 May 92 20:35:52 GMT
  297. Organization: Apple Computer, Inc.
  298.  
  299. [I wrote]
  300. > Parts of System 7, notably the Finder, were rewritten in C++.  Parts are in C,
  301. > and some parts may still be Pascal.  I don't believe any of it was ever Object
  302. > Pascal, but previous systems were written in a mixture of assembly and Pascal.
  303.  
  304. Of course, I should have mentioned that parts are in 680x0 assembly code.
  305.  
  306. - --
  307. David Casseres
  308. Exclaimer: Wow!
  309.  
  310.  
  311. +++++++++++++++++++++++++++
  312.  
  313. From: jordan@Apple.COM (Jordan Mattson)
  314. Date: 28 May 92 22:53:14 GMT
  315. Organization: Apple Computer Inc., Cupertino, CA
  316.  
  317. Dear Ian,
  318.  
  319. The System 7 Finder is written in C++.  The rest of the System 7 is written
  320. in a combination of 68K asm, C, and Pascal (not Object Pascal).
  321.  
  322. The only thing around Apple that was written in Object Pascal that was rewritten
  323. in C++ lately was MacApp.  It was moved from Object Pascal to C++ during the
  324. the transition from 2.0 to 3.0.
  325.  
  326.  
  327. - -- 
  328.  
  329.  
  330. Jordan Mattson                         UUCP:      jordan@apple.apple.com
  331. Apple Computer, Inc.                   CSNET:     jordan@apple.CSNET
  332. Development Tools Product Management   AppleLink: Mattson1 
  333. 20400 Stevens Creek Blvd, MS 75-8X
  334. Cupertino, CA 95014
  335. 408-974-4601
  336.             "Joy is the serious business of heaven."
  337.                     C.S. Lewis
  338.  
  339. +++++++++++++++++++++++++++
  340.  
  341. From: daven@notable.com (Dave Newman)
  342. Date: 29 May 92 02:39:58 GMT
  343. Organization: Notable Technologies, Inc.
  344.  
  345.  
  346. In article <1992May28.013408.27837@syacus.acus.oz.au> (comp.sys.mac.programmer), ian@syacus.acus.oz.au (Ian Joyner) writes:
  347. | Here is a question for you or anyone else who cares to clarify this point.
  348. | You may have read in comp.lang.c++ that Andrew Koenig claimed that
  349. | system 7 was rewritten in C++, from object Pascal. To my knowledge
  350. | previous systems were written in 68000 assembler, not OP. I believe
  351. | Finder has been rewritten in C++ (can't remember where I got this from,
  352. | maybe this newsgroup), but has the whole of system 7 been written
  353. | in C++?
  354.  
  355. Yes, the Finder for Sys 7 is written in C++ with some assembly for
  356. the good measure. However, Sys 7 itself is mostly assembly and C,
  357. and possibly a 'lil bit of Pascal.
  358.  
  359. - --Dave
  360.  
  361. - -----------------------------------------------------------
  362. Dave Newman                 |  AOL:      AFC Tinman
  363. Artillery Spotter           |  CIS:      70743,3323
  364. Notable Technologies, Inc.  |  internet: daven@notable.com
  365. 510.208.4449                |  FAX:      510.444.4493
  366. - -----------------------------------------------------------
  367.  
  368. +++++++++++++++++++++++++++
  369.  
  370. From: neeri@iis.ethz.ch (Matthias Neeracher)
  371. Organization: Integrated Systems Laboratory, ETH, Zurich
  372. Date: Fri, 29 May 1992 09:11:37 GMT
  373.  
  374. In article <25828@goofy.Apple.COM> casseres@apple.com (David Casseres) writes:
  375. >It's always amazed me how much folklore swirls around the question of what
  376. >languages have been used to implement the Mac system.
  377.  
  378. There is an easy way for Apple to squash those rumors: Publish the source :-)
  379.  
  380. >A few years back there
  381. >was a totally bogus story that the entire system had been rewritten in C instead
  382. >of Pascal, making it much faster.
  383.  
  384. On the other hand, when I was peeking around in the MIDI snth on System 6.0
  385. back in '88, I had the impression that some of the bugs had originated from
  386. using a K&R C compiler (caller and callee disagreed about the number of
  387. parameters etc.)
  388.  
  389. Matthias
  390.  
  391. - -----
  392. Matthias Neeracher                                      neeri@iis.ethz.ch
  393.  `We say "gestalt" when things combine to act in ways we can't explain'
  394.                              -- Marvin Minsky, _The Society Of Mind_
  395.  
  396. +++++++++++++++++++++++++++
  397.  
  398. From: blm@6sceng.UUCP (Brian Matthews)
  399. Date: 29 May 92 05:44:53 GMT
  400. Organization: Six Sigma CASE, Inc.
  401.  
  402. In article <D2150035.4ko79p@outpost.SF-Bay.org> peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  403. |I think it's difficult to say that any particular language was used
  404. |to write the Mac system.  Parts are writtren in a variety of languages.
  405. |680X0 asm is a good chunk, Pascal and C code are in there in some
  406. |places.  C++ was used to write most of the new Finder.
  407. |What does it really matter?
  408.  
  409. Well, having traced through parts of the System, ROMs, and Finder through
  410. the years for various reasons, I would say that the System 7 Finder, from
  411. an assembly point of view, is some of the worst code I've ever seen.  I
  412. don't know if it's an inherent limitation in C++ or Apple is using a
  413. horrible compiler, but if you trace through the Finder for a bit, it's
  414. obvious why the System 7 Finder is so ploddingly slow.
  415. - -- 
  416. Brian L. Matthews    blm@6sceng.UUCP
  417.  
  418. +++++++++++++++++++++++++++
  419.  
  420. From: edw@caligula.cts.com (Ed Watkeys)
  421. Date: Fri, 29 May 92 00:31:43 EDT
  422. Organization: Distant Software
  423.  
  424.  
  425. In article <25828@goofy.Apple.COM> (comp.sys.mac.programmer), casseres@apple.com (David Casseres) writes:
  426. > A few years back there
  427. > was a totally bogus story that the entire system had been rewritten in C instead
  428. > of Pascal, making it much faster.
  429.  
  430. A few months back, someone in Dr. Dobb's was interviewed and went on about
  431. the myth that C is faster than Pascal. From his arguments, I'm inclined to
  432. agree with him. I forget what issue it was, but I know that he wrote or is
  433. writing some sort of BASIC compiler for HyperCard or something.
  434.  
  435. Ed
  436.  
  437. - --
  438. Ed Watkeys, Sys Admin.  "...The errors of great men are more venerable
  439. Distant Software         because they are more fruitful than the truths
  440. edw@caligula.cts.com     of little men..."  -- Friedrich Nietzsche
  441.  
  442. +++++++++++++++++++++++++++
  443.  
  444. From: ksand@apple.com (Kent Sandvik)
  445. Date: 29 May 92 21:55:26 GMT
  446. Organization: MacDTS Mongols
  447.  
  448. In article <D2150035.4ko79p@outpost.SF-Bay.org>, peirce@outpost.SF-Bay.org
  449. (Michael Peirce) writes:
  450. > In article <1992May28.013408.27837@syacus.acus.oz.au>
  451. (comp.sys.mac.programmer), ian@syacus.acus.oz.au (Ian Joyner) writes:
  452. > > Kent,
  453. > > Here is a question for you or anyone else who cares to clarify this point.
  454. > > You may have read in comp.lang.c++ that Andrew Koenig claimed that
  455. > > system 7 was rewritten in C++, from object Pascal. To my knowledge
  456. > > previous systems were written in 68000 assembler, not OP. I believe
  457. > > Finder has been rewritten in C++ (can't remember where I got this from,
  458. > > maybe this newsgroup), but has the whole of system 7 been written
  459. > > in C++?
  460.  
  461. > I think it's difficult to say that any particular language was used
  462. > to write the Mac system.  Parts are writtren in a variety of languages.
  463. > 680X0 asm is a good chunk, Pascal and C code are in there in some
  464. > places.  C++ was used to write most of the new Finder.
  465.  
  466. > What does it really matter?
  467.  
  468. Actually it does somewhat, System 7 Finder is the most widely spread
  469. C++ application in the world, and market/language people like to point
  470. this out when people are skeptical about C++. I don't want to take any
  471. part in static language wars, I'm looking at better environments :-).
  472. - --
  473.                                               Cheers, Kent
  474.  
  475.  
  476. +++++++++++++++++++++++++++
  477.  
  478. From: ian@syacus.acus.oz.au (Ian Joyner)
  479. Organization: ACUS Australian Centre for Unisys Software, Sydney
  480. Date: Sat, 30 May 1992 12:08:30 GMT
  481.  
  482. peirce@outpost.SF-Bay.org (Michael Peirce) writes:
  483.  
  484.  
  485. >I think it's difficult to say that any particular language was used
  486. >to write the Mac system.  Parts are writtren in a variety of languages.
  487. >680X0 asm is a good chunk, Pascal and C code are in there in some
  488. >places.  C++ was used to write most of the new Finder.
  489.  
  490. Thanks for the reply, and for the others, that replied as well.
  491.  
  492. >What does it really matter?
  493.  
  494. Quite right. But it does matter when people make false claims.
  495. - -- 
  496. Ian Joyner  ACUS (Australian Centre for Unisys Software)    ian@syacus.acus.oz
  497. "Where is the man with all the great directions?...You can't imagine it,
  498.  how hard it is to grow, Can you imagine the order of the universe?" ABWH
  499. Disclaimer:Opinions and comments are personal.
  500.  
  501. +++++++++++++++++++++++++++
  502.  
  503. From: ksand@apple.com (Kent Sandvik)
  504. Date: 31 May 92 22:35:52 GMT
  505. Organization: MacDTS Mongols
  506.  
  507. In article <NEERI.92May29101137@iis.ethz.ch>, neeri@iis.ethz.ch (Matthias
  508. Neeracher) writes:
  509. > In article <25828@goofy.Apple.COM> casseres@apple.com (David Casseres) writes:
  510. > >It's always amazed me how much folklore swirls around the question of what
  511. > >languages have been used to implement the Mac system.
  512. > There is an easy way for Apple to squash those rumors: Publish the source :-)
  513.  
  514. Hehehe... Anyway, the trend inside System Software is to write more and more
  515. code in C and C++, including drivers. Why, because it makes life much easier
  516. when porting
  517. stuff between 68k and PowerPC platforms, including A/UX use.
  518. - --
  519.                                               Cheers, Kent
  520.  
  521.  
  522.  
  523. +++++++++++++++++++++++++++
  524.  
  525. From: mxmora@unix.SRI.COM (Matt Mora)
  526. Date: 2 Jun 92 21:26:28 GMT
  527. Organization: SRI International, Menlo Park, California
  528.  
  529. In article <01050133.4mavej@caligula.cts.com> edw@caligula.cts.com (Ed Watkeys) writes:
  530.  
  531. >A few months back, someone in Dr. Dobb's was interviewed and went on about
  532. >the myth that C is faster than Pascal. From his arguments, I'm inclined to
  533. >agree with him. I forget what issue it was, but I know that he wrote or is
  534. >writing some sort of BASIC compiler for HyperCard or something.
  535.  
  536. Hey careful there. We don't want to start the C is faster than Pascal
  537. flamewar again. Speed of the application is dependent upon the "smartness"
  538. of the compiler and the skill of the programmer not the language used.
  539. You can't make general claims like that about languages. Think Pascal
  540. has been proven to beat Think C in a few examples in producing faster code.
  541. This was in the past before Think C had an optimizer. Things have probably
  542. changed since then. 
  543.  
  544. Matt
  545.  
  546.  
  547.   
  548. - -- 
  549. ___________________________________________________________
  550. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  551. SRI International           |  my unix  mxmora@unix.sri.com
  552. ___________________________________________________________
  553.  
  554. +++++++++++++++++++++++++++
  555.  
  556. From: nebel@wam.umd.edu (Chris D. Nebel)
  557. Organization: University of Maryland at College Park
  558. Date: Wed, 3 Jun 1992 14:15:58 GMT
  559.  
  560. In article <35602@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  561. >In article <01050133.4mavej@caligula.cts.com> edw@caligula.cts.com (Ed Watkeys) writes:
  562. >
  563. >A few months back, someone in Dr. Dobb's was interviewed and went on about
  564. >the myth that C is faster than Pascal.
  565.  
  566. This reminds me of an article I saw a couple of years back: it was a commentary
  567. by Dave Small about the trials and travails he had writing writing the Spectre,
  568. a (sort of) Mac emulator for the Atari ST.  He went on for a while about how
  569. the entire Mac system bit the big one because it was all based around that
  570. horrible, godawful language Pascal, instead of a nice, efficient, sensible one
  571. like C (which the ST OS was written in (I think.)) [this is irony, folks! No
  572. flames!]  His main two gripes were that (1) Pascal was hideously slow and (2)
  573. that any program written in Pascal was automatically really huge, because using
  574. just one routine from a library would put the entire library in your program
  575. (giving such fun things as a 200K "hello world" program).
  576.  
  577. The funny thing is that both of these gripes are absolutely true -- of UCSD
  578. Pascal for the Apple II, the official Apple-distributed Pascal for the Apple II at the time.  Nothing like first impressions, eh?
  579.  
  580. Chris Nebel
  581. nebel@wam.umd.edu
  582.  
  583. +++++++++++++++++++++++++++
  584.  
  585. From: orpheus@reed.edu (P. Hawthorne)
  586. Date: 4 Jun 92 08:58:55 GMT
  587. Organization: Reed College, Portland, Oregon
  588.  
  589.  
  590.   Ed Watkeys, edw@caligula.cts.com, confers:
  591. . A few months back, someone in Dr. Dobb's was interviewed and went on about
  592. . the myth that C is faster than Pascal. From his arguments, I'm inclined to
  593. . agree with him. I forget what issue it was, but I know that he wrote or is
  594. . writing some sort of BASIC compiler for HyperCard or something.
  595.  
  596.   Somehow it seems that a BASIC compiler for HyperCard sounds like frozen
  597. molasses moving uphill during a Utah Winter. First impressions, I guess...
  598.  
  599.   Unless there is a lot of time or experience devoted to making the lowest
  600. levels of a framework as tight as possible, any layered project is going to
  601. be slow. Sometimes it seems that you can have only ever have a robust
  602. project, an efficient project, or a lackluster tradeoff between the two.
  603.  
  604.   Imho, anything extending HyperCard functionality is going to have to be
  605. just blatantly and convincingly fast or it could be dismissed as a dog.
  606. Interesting point, though. Understable for this guy to make it, given the
  607. project you say he's working on.
  608.  
  609.  
  610.   Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  611. . Speed of the application is dependent upon the "smartness" of the
  612. . compiler and the skill of the programmer not the language used.  You
  613. . can't make general claims like that about languages.
  614.  
  615.   Granted. However, there must be some plausible explanation for why so
  616. many C programmers so often claim that C is inherently faster than Pascal,
  617. or why so many C programmers cite the bad points of ancient Pascal dialects
  618. as proof of the superiority of C.
  619.  
  620.   One of the things I hear most often is that C is more "low level" than
  621. Pascal, and therefore obviously going to be faster. Dubious, ain't it?
  622.  
  623.   Imho, the idea that a lower level of abstraction brings with it speed
  624. flies in the face of algorithms and problem solving.
  625.  
  626.   For instance, I find that the "with" statement in Pascal helps me to
  627. write and read much more expressive code for the perfect data structure in
  628. the appropriate algorithm than, say, register variables in C helps me to.
  629.  
  630.   While I yearn for a macro facility and an assembler within Pascal, I owe
  631. a great deal of the efficiency of the projects I can write in a finite
  632. amount of time to the "with" statement. I'm not trying to start a flamewar
  633. here, just pointing out something I find significant.
  634.  
  635.  
  636.   Matt Mora then goes on to say:
  637. . Think Pascal has been proven to beat Think C in a few examples in producing
  638. . faster code. This was in the past before Think C had an optimizer. Things
  639. . have probably changed since then.
  640.  
  641.   The two do seem to be equivalent in speed of compiled code. Of course,
  642. the best compiler optimization pales against a more appropriate algorithm.
  643. Then again, Pascal does seem to be going the way of Pick and News... A lot
  644. more people write C compilers than Pascal compilers in school... I dare say
  645. that real soon now, comparing C and Pascal will be like comparing fractals
  646. and Newtonian forward differencing. (What's that? That's the point.)
  647.  
  648.   I dunno for sure, but I think that both of those products could be
  649. optimized further. I have written anything that does a better job, so my
  650. opinion isn't really worth anything at all. I suspect, however, register
  651. allocation could be improved with peephole optimization tempered by special
  652. cases for the register-based traps.
  653.  
  654.   My kingdom for a new and improved object method dispatching technique!
  655. Does Objective C on the NeXT do something the two Think products don't?
  656.  
  657.   Theus (orpheus@reed.edu) 
  658.  
  659. +++++++++++++++++++++++++++
  660.  
  661. From: mxmora@unix.SRI.COM (Matt Mora)
  662. Date: 5 Jun 92 18:35:08 GMT
  663. Organization: SRI International, Menlo Park, California
  664.  
  665. In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  666.  
  667. >  Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  668. >. Speed of the application is dependent upon the "smartness" of the
  669. >. compiler and the skill of the programmer not the language used.  You
  670. >. can't make general claims like that about languages.
  671.  
  672. >  Granted. However, there must be some plausible explanation for why so
  673. >many C programmers so often claim that C is inherently faster than Pascal,
  674. >or why so many C programmers cite the bad points of ancient Pascal dialects
  675. >as proof of the superiority of C.
  676.  
  677. Is this the same C that now has strict prototype checking, check pointer
  678. types and all the nasty type checking that Pascal has? Hmmm sounds
  679. like the same "bad points of ancient Pascal dialects as proof of the 
  680. superiority of C" is now being infiltrated into C. :-)
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688. Matt
  689.  
  690. - -- 
  691. ___________________________________________________________
  692. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  693. SRI International           |  my unix  mxmora@unix.sri.com
  694. ___________________________________________________________
  695.  
  696. +++++++++++++++++++++++++++
  697.  
  698. From: buckeye@spf.trw.com (John Wallace)
  699. Organization: TRW Data Systems Center, Redondo Beach, CA
  700. Date: Sat, 6 Jun 92 01:58:15 GMT
  701.  
  702. In article <35705@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  703. >In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  704. >
  705. >>  Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  706. >>. Speed of the application is dependent upon the "smartness" of the
  707. >>. compiler and the skill of the programmer not the language used.  You
  708. >>. can't make general claims like that about languages.
  709. >
  710. >>  Granted. However, there must be some plausible explanation for why so
  711. >>many C programmers so often claim that C is inherently faster than Pascal,
  712. >>or why so many C programmers cite the bad points of ancient Pascal dialects
  713. >>as proof of the superiority of C.
  714. >
  715. >Is this the same C that now has strict prototype checking, check pointer
  716. >types and all the nasty type checking that Pascal has? Hmmm sounds
  717. >like the same "bad points of ancient Pascal dialects as proof of the 
  718. >superiority of C" is now being infiltrated into C. :-)
  719. >
  720.  
  721. Choice of language usually boils down to a matter of preference and
  722. which is best supported on a system.  When I program Suns, I use C.
  723. When I program NeXTs I use Objective C.  When I program Macs, I use
  724. Pascal.  In each case I use the language that makes the fewest waves
  725. on that platform.
  726.  
  727. As to "which is faster: C or Pascal", I'll agree with Matt: it depends
  728. on the compiler.  There is nothing inherintly faster in C. Most
  729. compiler writers acknowledge that it is much easier to make a low-end C 
  730. compiler than a Pascal compiler.  BUT, as soon as you're talking about 
  731. an optimizing compiler, it is MUCH easier to produce a highly optimizing 
  732. Pascal compiler because of the idealized for loop, strong type checking, 
  733. and rarity of pointers.  Looking at the state of things today on the Mac, 
  734. the performance of Pascal and C is within a couple of percent either
  735. way, depending on the application.  If you want a big performance 
  736. increase (100% to 500%), use assembler.
  737.  
  738. As far as saying: 
  739. >>  ... there must be some plausible explanation for why so
  740. >>many C programmers so often claim that C is inherently faster than Pascal,
  741. >>or why so many C programmers cite the bad points of ancient Pascal dialects
  742. >>as proof of the superiority of C.
  743.  
  744. It just sounds like _software racism_ to me :-)
  745.  
  746. Cheers!
  747. John
  748. - ----
  749. John Wallace    buckeye@spf.trw.com
  750.  
  751.  
  752. +++++++++++++++++++++++++++
  753.  
  754. From: peirce@outpost.SF-Bay.org (Michael Peirce)
  755. Date: 6 Jun 92 00:16:24 GMT
  756. Organization: Peirce Software
  757.  
  758.  
  759. In article <35705@unix.SRI.COM> (comp.sys.mac.programmer), mxmora@unix.SRI.COM (Matt Mora) writes:
  760. > In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  761. > >  Matt Mora, mxmora@unix.SRI.COM, quite rightly mentions:
  762. > >. Speed of the application is dependent upon the "smartness" of the
  763. > >. compiler and the skill of the programmer not the language used.  You
  764. > >. can't make general claims like that about languages.
  765. > >  Granted. However, there must be some plausible explanation for why so
  766. > >many C programmers so often claim that C is inherently faster than Pascal,
  767. > >or why so many C programmers cite the bad points of ancient Pascal dialects
  768. > >as proof of the superiority of C.
  769. > Is this the same C that now has strict prototype checking, check pointer
  770. > types and all the nasty type checking that Pascal has? Hmmm sounds
  771. > like the same "bad points of ancient Pascal dialects as proof of the 
  772. > superiority of C" is now being infiltrated into C. :-)
  773.  
  774. I've always though it humorous that C continues to load up with features
  775. from the languages that hard core C people used to hate.  Your comments
  776. about strict type checking above are one example.  C++ goes even further
  777. in this direction adding a number of great features from Ada (operator
  778. overloading, exception handling, and generics for instance - C++ even
  779. uses the bazarre word pragma just like Ada :-) ).
  780.  
  781. Not that I'm complaining.  C (& C++) has gotten almost useable over
  782. the years - thank goodness since its harder and harder to resist using it.
  783.  
  784. P.S.  If only Ada had been invented a few years later and gotten real
  785. OOPs included we'd have a decient language for MacApp!  
  786.  
  787. - --  Michael Peirce      --   peirce@outpost.SF-Bay.org
  788. - --  Peirce Software     --   Suite 301, 719 Hibiscus Place
  789. - --  Makers of...        --   San Jose, California USA 95117
  790. - --                      --   voice: (408) 244-6554 fax: (408) 244-6882
  791. - --     SMOOTHIE         --   AppleLink: peirce & America Online: AFC Peirce
  792.  
  793. +++++++++++++++++++++++++++
  794.  
  795. From: orpheus@reed.edu (P. Hawthorne)
  796. Date: 6 Jun 92 07:07:53 GMT
  797. Organization: Reed College, Portland, Oregon
  798.  
  799.  
  800.   Prometheus Hawthorne, orpheus@reed.edu, writes:
  801. . However, there must be some plausible explanation for why....  so many C
  802. . programmers cite the bad points of ancient Pascal dialects as proof of the
  803. . superiority of C.
  804.  
  805.   Matt Mora, mxmora@unix.SRI.COM, writes:
  806. . Is this the same C that now has strict prototype checking, check pointer
  807. . types and all the nasty type checking that Pascal has?
  808.  
  809.   Michael Pierce, peirce@outpost.SF-Bay.org, writes:
  810. . I've always though it humorous that C continues to load up with features
  811. . from the languages that hard core C people used to hate.... 
  812.  
  813.   Yeah. It may seem hypocritical on hindsight, but Pascal could do with
  814. some of that vibrancy. C does seem to be very much a living language, being
  815. extended and redefined. My father has always given me an odd perspective on
  816. things about computers. He was a computer nerd, just like his dad was, and
  817. there's a certain historical context that pokes up every now and then.
  818.  
  819.   For instance, some time ago, my dad asked me if I was using Algol now. I
  820. just din't have the heart to tell him that it was Object Pascal, since this
  821. was just after he found out how cheap megabytes of memory are for me now.
  822. He was still a little sore. He's still lecturing me about the time he spent
  823. weaving magnetic core memory and saying that if I can't do something in 4K,
  824. I should just give up now. Noble... Ancient but noble.
  825.  
  826.   Then I started to notice things from my really old Encyclopedia of
  827. Computer Science. (It was a childhood altar for me.) I had no idea at the
  828. time, but Pascal is pretty much Algol 68 with a bunch more data types. The
  829. object extensions are about all that has really changed with the language
  830. since then, it begins to seem.
  831.  
  832.  
  833.   Michael Pierce, peirce@outpost.SF-Bay.org, elaborates:
  834. . C++ goes even further in this direction adding a number of great features
  835. . from Ada (operator overloading, exception handling, and generics for
  836. . instance - C++ even uses the bazarre word pragma just like Ada :-) ).
  837. . P.S. If only Ada had been invented a few years later and gotten real
  838. . OOPs included we'd have a decent language for MacApp!  
  839.  
  840.   Ada compilers sure are priced for government contractor's budgets! It 
  841. reads nicely, and I've liked what I've seen, but the user base sure is a
  842. lot more bloated... er, sure are a lot more affluent than I am!
  843.   Speaking of Ada, I would like to think that Pascal could incorporate the
  844. actor-based systems paradigm and regain a bit of the luster it has lost
  845. over the years, but the momentum does seem to be on the side of C.
  846.   Besides, how could anyone ever convince Borland to incorporate actor
  847. extensions into Turbo Pascal?
  848.  
  849.   Theus
  850.   orpheus@reed.edu
  851.  
  852. +++++++++++++++++++++++++++
  853.  
  854. From: Bruce.Hoult@bbs.actrix.gen.nz
  855. Date: Sun, 7 Jun 1992 15:34:32 GMT
  856. Organization: Actrix Information Exchange
  857.  
  858. In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  859. >   My kingdom for a new and improved object method dispatching technique!
  860. > Does Objective C on the NeXT do something the two Think products don't?
  861.  
  862.  
  863. Have you looked at C++?
  864.  
  865. The method dispatch code possible with C++ (especially the non-multiple-
  866. inheritance style found in CFront 1.2 and "SingleObject" descendents in
  867. Apples version) is about as efficient as it's possible to get.
  868.  
  869. - -- 
  870. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  871. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  872. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  873. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  874.  
  875. +++++++++++++++++++++++++++
  876.  
  877. From: newbery@rata.vuw.ac.nz (Michael Newbery)
  878. Date: Sun, 7 Jun 1992 21:57:15 GMT
  879. Organization: Computing Serv. Ctr, Victoria Uni., Wellington, New Zealand
  880.  
  881. In article <1992Jun6.070753.16192@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  882. >  Then I started to notice things from my really old Encyclopedia of
  883. >Computer Science. (It was a childhood altar for me.) I had no idea at the
  884. >time, but Pascal is pretty much Algol 68 with a bunch more data types. The
  885. >object extensions are about all that has really changed with the language
  886. >since then, it begins to seem.
  887.  
  888. Pardon? I assume/hope you mean Algol 60.
  889.  
  890. Algol68 has lots of stuff lacking in Pascal, including rather more data
  891. types, operator overloading, etc. etc.
  892.  
  893. - --
  894. Michael.Newbery@vuw.ac.nz
  895. There is no national science just as there is no national multiplication table;
  896.  
  897. +++++++++++++++++++++++++++
  898.  
  899. From: ksand@apple.com (Kent Sandvik)
  900. Date: 8 Jun 92 03:01:46 GMT
  901. Organization: MacDTS Mongols
  902.  
  903. In article <1992Jun7.153432.20292@actrix.gen.nz>, Bruce.Hoult@bbs.actrix.gen.nz
  904. writes:
  905. > In article <1992Jun4.085855.20844@reed.edu> orpheus@reed.edu (P. Hawthorne)
  906. writes:
  907. > >   My kingdom for a new and improved object method dispatching technique!
  908. > > Does Objective C on the NeXT do something the two Think products don't?
  909. > Have you looked at C++?
  910.  
  911. > The method dispatch code possible with C++ (especially the non-multiple-
  912. > inheritance style found in CFront 1.2 and "SingleObject" descendents in
  913. > Apples version) is about as efficient as it's possible to get.
  914.  
  915.    And no dynamic runtime method dispatching, something that Objective-C has.
  916. Sigh. I guess the runtime binding standardization efforts will produce
  917. this feature, 1994 or so.
  918. - --
  919.                                               Cheers, Kent
  920.  
  921.  
  922. +++++++++++++++++++++++++++
  923.  
  924. From: urlichs@smurf.sub.org (Matthias Urlichs)
  925. Date: 23 Jun 1992 13:20:50 +0200
  926. Organization: University of Karlsruhe, FRG
  927.  
  928. In comp.sys.mac.programmer, article <1992Jun3.141558.12607@wam.umd.edu>,
  929.   nebel@wam.umd.edu (Chris D. Nebel) writes:
  930. < In article <35602@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:
  931. < >A few months back, someone in Dr. Dobb's was interviewed and went on about
  932. < >the myth that C is faster than Pascal.
  933. <This reminds me of an article I saw a couple of years back: it was a commentary
  934. <by Dave Small about the trials and travails he had writing writing the Spectre,
  935. <a (sort of) Mac emulator for the Atari ST.  He went on for a while about how
  936. <the entire Mac system bit the big one because it was all based around that
  937. <horrible, godawful language Pascal, instead of a nice, efficient, sensible one
  938. <like C (which the ST OS was written in (I think.)) [this is irony, folks! No
  939. <flames!]  His main two gripes were that (1) Pascal was hideously slow and (2)
  940. <that any program written in Pascal was automatically really huge, because using
  941. <just one routine from a library would put the entire library in your program
  942. <(giving such fun things as a 200K "hello world" program).
  943. < The funny thing is that both of these gripes are absolutely true -- of UCSD
  944. < Pascal for the Apple II, the official Apple-distributed Pascal for the Apple
  945. < II at the time.  Nothing like first impressions, eh?
  946.  
  947. The observation about linking is also true for at least one of the early
  948. Pascal compilers for the Mac, and probably also for at least one Pascal on
  949. the Atari. ;-) Incidentally, it's also true for about every development
  950. system on about every existing UNIX machine. Yes, this includes C.
  951.  
  952. BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  953. conventions on the 68000. The trap dispatcher is a beast which probably would
  954. be implemented quite differently today, also...
  955.  
  956. - -- 
  957. "I've been called an evil genius by cities of assholes...  but I know who
  958.  these people are!  And they're on my list!" 
  959.  -- Robert Crumb
  960. - -- 
  961. Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
  962. Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
  963.  
  964. +++++++++++++++++++++++++++
  965.  
  966. From: Bruce.Hoult@bbs.actrix.gen.nz
  967. Date: 24 Jun 92 09:32:51 GMT
  968. Organization: Actrix Information Exchange
  969.  
  970. In article <1271eiINNeb9@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
  971. > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  972. > conventions on the 68000. The trap dispatcher is a beast which probably would
  973. > be implemented quite differently today, also...
  974.  
  975. Interesting.
  976.  
  977. Over on the MSDog side, Walter Bright (author of the Zortech C and C++
  978. (and before that Datalight) compilers) says that one of the big wins
  979. in compiling C code using a C++ compiler is that C++ is able to use
  980. "Pascal" calling conventions for speed.
  981.  
  982. This is because C compilers have to be prepared to accept any number
  983. of parameters, wheras C++ (unless you use ...) and Pascal functions
  984. have a fixed numnber of parameters.
  985. - -- 
  986. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  987. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  988. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  989. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  990.  
  991. +++++++++++++++++++++++++++
  992.  
  993. From: ksand@apple.com (Kent Sandvik (High Priest of SSSM))
  994. Date: 29 Jun 92 02:07:16 GMT
  995. Organization: Secret Society of Software Mungers
  996.  
  997. In article <1271eiINNeb9@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias
  998. Urlichs) writes:
  999. > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  1000. > conventions on the 68000. The trap dispatcher is a beast which probably would
  1001. > be implemented quite differently today, also...
  1002.  
  1003. So, does anyone know the story why Windows uses pascal calling conventions in
  1004. their
  1005. API, performance reasons?
  1006.  
  1007. Cheers,
  1008. Kent
  1009.  
  1010. +++++++++++++++++++++++++++
  1011.  
  1012. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  1013. Organization: Symantec Corp.
  1014. Date: Mon, 29 Jun 1992 14:10:33 GMT
  1015.  
  1016. In article <27517@goofy.Apple.COM> ksand@apple.com (Kent Sandvik (High Priest of SSSM)) writes:
  1017.    In article <1271eiINNeb9@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias Urlichs) writes:
  1018.    > BTW, he's got one point -- Pascal calling conventions are a bit
  1019.    > slower than C conventions on the 68000. The trap dispatcher is a
  1020.    > beast which probably would be implemented quite differently
  1021.    > today, also...
  1022.  
  1023.    So, does anyone know the story why Windows uses pascal calling
  1024.    conventions in their API, performance reasons?
  1025.  
  1026. Code size. Since the bulk of glue code is pushing args on the stack
  1027. and popping them off, and since Pascal conventions require that the
  1028. callee pops off the arguments, using Pascal calling conventions places
  1029. half of that code inside the Mac ROMs (or Windows DLLs). If your code
  1030. contains more than one call to any single library routine, then you've
  1031. saved a couple bytes of code.
  1032.  
  1033. Many DOS compilers provide an option that changes all of your C
  1034. routines to use Pascal calling conventions for just this reason
  1035. (except for those explicitly declared as cdecl, so you can still call
  1036. stdio routines). You can of course do this explicitly by using the
  1037. pascal keyword before each function, or by using extern "Pascal" in
  1038. C++.
  1039.  
  1040. Some C compilers have an optimization that reduces the code size
  1041. difference by waiting until the end of a block/function to remove the
  1042. arguments from the stack; in THINK C this is called "defer and combine
  1043. stack adjusts".
  1044.  
  1045.     -phil
  1046. - --
  1047.    Phil Shapiro                                   Software Engineer
  1048.    Language Products Group                     Symantec Corporation
  1049.            Internet: phils@cs.brandeis.edu
  1050.  
  1051. +++++++++++++++++++++++++++
  1052.  
  1053. From: cory@enigami.mv.com (Cory Kempf)
  1054. Date: 30 Jun 92 23:29:46 GMT
  1055. Organization: EnigamI, Inc., Nashua, NH
  1056.  
  1057.  
  1058. In article <27517@goofy.Apple.COM> (comp.sys.mac.programmer), ksand@apple.com (Kent Sandvik (High Priest of SSSM)) writes:
  1059. >In article <1271eiINNeb9@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias
  1060. >Urlichs) writes:
  1061. >> BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  1062. >> conventions on the 68000. The trap dispatcher is a beast which probably would
  1063. >> be implemented quite differently today, also...
  1064. >
  1065. >So, does anyone know the story why Windows uses pascal calling conventions in
  1066. >their
  1067. >API, performance reasons?
  1068.  
  1069. You mean is wasn't just because that is what Apple used?????
  1070.  
  1071. Grin.
  1072.  
  1073. +C
  1074.  
  1075.  
  1076. - -------------------------------------------------------------
  1077. Cory Kempf                    EnigamI, Inc.
  1078. cory@enigami.mv.com           ...!decvax!enigami!cory
  1079. Annon:    wi.5036@wizvax.methuen.ma.us
  1080. "Reporter : Mr Gandhi, what do you think of Western Civilization ?
  1081. Gandhi : I think it would be a good idea."
  1082.  
  1083. +++++++++++++++++++++++++++
  1084.  
  1085. From: urlichs@smurf.sub.org (Matthias Urlichs)
  1086. Date: 4 Jul 92 04:51:23 GMT
  1087. Organization: University of Karlsruhe, FRG
  1088.  
  1089. In comp.sys.mac.programmer, article <1992Jun24.093251.3225@actrix.gen.nz>,
  1090.   Bruce.Hoult@bbs.actrix.gen.nz writes:
  1091. < In article <1271eiINNeb9@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
  1092. < > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  1093. < > conventions on the 68000. The trap dispatcher is a beast which probably would
  1094. < > be implemented quite differently today, also...
  1095. < Interesting.
  1096. < Over on the MSDog side, Walter Bright (author of the Zortech C and C++
  1097. < (and before that Datalight) compilers) says that one of the big wins
  1098. < in compiling C code using a C++ compiler is that C++ is able to use
  1099. < "Pascal" calling conventions for speed.
  1100. < This is because C compilers have to be prepared to accept any number
  1101. < of parameters, wheras C++ (unless you use ...) and Pascal functions
  1102. < have a fixed numnber of parameters.
  1103.  
  1104. I don't know zilch about 80x86 calling conventions.  ;-)
  1105.  
  1106. On the Mac, however, C and Pascal conventions pass arguments on the stack
  1107. (except for the return value in C). Specifically:
  1108.  
  1109.         C                Pascal
  1110.  
  1111.                     (Reserve space for return value
  1112.                             on stack)
  1113.     Push args, right to left    Push args, left to right
  1114.     Call function            Call function
  1115.         [ Function ]            [ Function ]
  1116.         (Move return value into D0)        (Move return value onto stack)
  1117.                         Pop return address into register
  1118.                         Pop arguments off stack
  1119.         Return via RTS            Return via register
  1120.     Pop arguments off stack        (Get result off stack)
  1121.  
  1122. Stuff in parentheses only applies to functions.
  1123.  
  1124. Obviously, C is cheaper. The C conventions have the added benefit that
  1125. you can let the arguments accumulate on the stack and then pop them all
  1126. at once.
  1127. Having a variable number of arguments is not interesting in the C case
  1128. because the first arg always is at the top of the stack; thus the compiler
  1129. doesn't have to do anything special for varargs, nor does "procedure" code
  1130. differ from "function" code.
  1131.  
  1132. Interestingly, no Mac language uses register-based calling conventions.
  1133. Register-based calling is, in itself, obviously faster than either of the
  1134. above schemes because you don't need to access the stack. However, if you
  1135. push multiple arguments you effectively steal registers from the compiler so
  1136. that setting up the procedure call may get more expensive. Plus, the
  1137. procedure then may have to move yet-unused parameters off to the stack
  1138. in order to do its job. Whether this tends to increase or decrease running
  1139. time is anybody's guess.
  1140.  
  1141. - -- 
  1142. "A raccoon tangled with a 23,000 volt line today.  The results blacked
  1143. out 1400 homes and, of course, one raccoon."
  1144.         -- Steel City News
  1145. - -- 
  1146. Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
  1147. Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
  1148.  
  1149. +++++++++++++++++++++++++++
  1150.  
  1151. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1152. Date: 6 Jul 92 03:37:42 GMT
  1153. Organization: University of Waikato, Hamilton, New Zealand
  1154.  
  1155. In article <132smbINN5te@smurf.smurf.sub.org>, urlichs@smurf.sub.org (Matthias Urlichs) writes:
  1156. > In comp.sys.mac.programmer, article <1992Jun24.093251.3225@actrix.gen.nz>,
  1157. >   Bruce.Hoult@bbs.actrix.gen.nz writes:
  1158. > < In article <1271eiINNeb9@smurf.smurf.sub.org> urlichs@smurf.sub.org (Matthias Urlichs) writes:
  1159. > < > BTW, he's got one point -- Pascal calling conventions are a bit slower than C
  1160. > < > conventions on the 68000. The trap dispatcher is a beast which probably would
  1161. > < > be implemented quite differently today, also...
  1162. > <
  1163. > < Interesting.
  1164. > <
  1165. > < Over on the MSDog side, Walter Bright (author of the Zortech C and C++
  1166. > < (and before that Datalight) compilers) says that one of the big wins
  1167. > < in compiling C code using a C++ compiler is that C++ is able to use
  1168. > < "Pascal" calling conventions for speed.
  1169. > <
  1170. > < This is because C compilers have to be prepared to accept any number
  1171. > < of parameters, wheras C++ (unless you use ...) and Pascal functions
  1172. > < have a fixed numnber of parameters.
  1173. >
  1174. > I don't know zilch about 80x86 calling conventions.  ;-)
  1175. >
  1176. > On the Mac, however, C and Pascal conventions pass arguments on the stack
  1177. > (except for the return value in C). Specifically:
  1178. >
  1179. >         C                Pascal
  1180. >
  1181. >                     (Reserve space for return value
  1182. >                             on stack)
  1183. >     Push args, right to left    Push args, left to right
  1184. >     Call function            Call function
  1185. >         [ Function ]            [ Function ]
  1186. >         (Move return value into D0)        (Move return value onto stack)
  1187. >                         Pop return address into register
  1188. >                         Pop arguments off stack
  1189. >         Return via RTS            Return via register
  1190. >     Pop arguments off stack        (Get result off stack)
  1191. >
  1192. > Stuff in parentheses only applies to functions.
  1193. >
  1194. > Obviously, C is cheaper.
  1195.  
  1196. Yeah, until you get into things like function results bigger than will
  1197. fit into a register. Also, the Pascal convention is quicker for short
  1198. routines, particularly those written in assembler. This is because you
  1199. can pop each argument off the stack as you use it, eg:
  1200.  
  1201. ULMUL    proc    export
  1202. ;+
  1203. ; Function ULMul
  1204. ;   (
  1205. ;     A, B : LongInt
  1206. ;   ) : LongInt
  1207. ; returns unsigned long-integer product of A and B.
  1208. ;-
  1209.     move.l    (sp)+, a0    ; return address
  1210.     move.l    (sp)+, d1    ; value of B
  1211.     move.l    (sp)+, d0    ; value of A
  1212. ... main part of routine omitted ...
  1213.     move.l    d2, (sp)    ; return result
  1214.     jmp    (a0)        ; all done
  1215.     endproc ; ULMUL
  1216.  
  1217.  
  1218. > Interestingly, no Mac language uses register-based calling conventions.
  1219.  
  1220. I think Consulair Mac C used to. And the current version of MPW C of course
  1221. supports it. I guess this convention works best for leaf routines--those which
  1222. don't in their turn call other routines. Otherwise you still have to stack
  1223. those values when making the inner routine call, which gives you your stack
  1224. overhead back again.
  1225.  
  1226. A similar thing applies to the decision as to whether the called routine
  1227. or the caller has to save registers used internally by the called routine.
  1228. The Metrowerks Modula-2 compiler by default makes the caller responsible for
  1229. the saving, which is contrary to the usual Mac system convention. Again, I'd
  1230. say this works best for leaf routines, and doesn't gain you anything in other
  1231. situations (except headaches when I forget to call SAVEREGS in a routine being
  1232. called by some system code :-)).
  1233.  
  1234. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1235. Computer Services Dept                     fax: +64-7-838-4066
  1236. University of Waikato            electric mail: ldo@waikato.ac.nz
  1237. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  1238. To someone with a hammer and a screwdriver, every problem looks
  1239. like a nail with threads.
  1240.  
  1241. +++++++++++++++++++++++++++
  1242.  
  1243. From: Quinn <quinn@cs.uwa.edu.au>
  1244. Organization: The University of Western Australia
  1245. Date: Tue, 7 Jul 1992 02:08:12 GMT
  1246.  
  1247.  
  1248.  
  1249. In article <132smbINN5te@smurf.smurf.sub.org> Matthias Urlichs,
  1250. urlichs@smurf.sub.org writes:
  1251. >On the Mac, however, C and Pascal conventions pass arguments on the stack
  1252. >(except for the return value in C). Specifically:
  1253. >
  1254. >        C                Pascal
  1255. >
  1256. >                    (Reserve space for return value
  1257. >                            on stack)
  1258. >    Push args, right to left    Push args, left to right
  1259. >    Call function            Call function
  1260. >        [ Function ]            [ Function ]
  1261. >        (Move return value into D0)        (Move return value onto stack)
  1262. >                        Pop return address into register
  1263. >                        Pop arguments off stack
  1264. >        Return via RTS            Return via register
  1265. >    Pop arguments off stack        (Get result off stack)
  1266. >
  1267. >Obviously, C is cheaper.
  1268.  ^^^^^^^^^^^^^^^^^^^^^^^
  1269. Hmmm, "cheaper" may be obvious to you.  And I'd certainly agree with
  1270. "faster"
  1271. and more "flexible" but "smaller" I'm not so sure.  C has every function
  1272. *caller* removing arguments, Pascal has every *function/procedure*
  1273. removing
  1274. arguments. Now a function must be called at least as many times as it's
  1275. declared (Yay for smart linking!) thus is seems that Pascal could be
  1276. making
  1277. smaller code.
  1278.  
  1279. Not that this is significant in the global scale of things.  Like the hit
  1280. Pascal takes because the 68000 doesn't have an RTD instruction.  I'm just
  1281. here to suggest that "all sweeping generalisations are wrong".
  1282.  
  1283. However C returning function results in D0 is a Big Win (tm).  But life
  1284. is easy when you only have to worry about returning longs and smaller
  1285. from functions.  Perhaps it would have been smarter for Pascal to
  1286. use a register for small things and the stack for large.
  1287.  
  1288. Regardless it would seem IMHO that register based calling conventions are
  1289. the way to go anyway.  [That's most probably because I like putting lots
  1290. of small subroutines in my program rather than few big one.  Hell, I think
  1291. it makes them easier to read (-: ]  But all these things were graven in
  1292. stone
  1293. a very long time ago.
  1294.  
  1295. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  1296. Department of Computer Science, The University of Western Australia
  1297.   -- Quinn says "Don't put tabs in your postings to Mac groups!"
  1298.  
  1299. ---------------------------
  1300.  
  1301. End of C.S.M.P. Digest
  1302. **********************
  1303.